﻿using System;
namespace test
{
    public enum Day
    {
        monday,
        turesday,
        thuresday,
        weendsday
    }

    struct student
    {
        public int _age;
        public string _name;
        public string _sex;
    }

    class Program
    {
        public static int a = 0;
        public static string user_name = "小华";
        public static string user_passward = "123456789";
        static public void Main(string[] args)
        {
            #region 一次实验
            //Console.WriteLine("Hello World!");
            //Console.Write("please write you times:");
            //int times = 0;
            //times =Convert.ToInt32(Console.ReadLine());
            //Console.WriteLine("{0}天", times / (60 * 60 * 24));
            //Random x = new Random();
            //int k=x.Next(1,11);
            #endregion
            #region
            //int m = -1;
            //Day day = (Day)m;
            //Console.WriteLine(day);
            //Console.WriteLine(typeof(Day));
            //test.Day x = test.Day.monday;
            //Console.WriteLine("请选择今天是星期几1，星期一，2星期二，3星期三，4星期四");
            //string input = Console.ReadLine();
            //Console.WriteLine((Day)(int.Parse(input) - 1));
            //test.student[] student = new student[10];
            //student[0]._name = "xiaosan";
            //student.GetValue(1);
            //int b = 3;
            //int cc = a;
            #endregion
            #region 关于out的简单尝试
            //int reTurnMax = GetNnumber();
            //Console.WriteLine(GetNnumber());
            //student student1 = GetStudentInformation();
            //student student;
            //GetStudentInformation(out student._age, out student._name, out student._sex);
            //Console.WriteLine(student._age);
            //bool judgeUsername = false;
            //bool judgeUserpassward = false;
            //string userName;
            //string userPassward;
            #endregion
            #region 关于out的一次实际应用
            //while (true)
            //{
            //    Console.WriteLine("请输入用户姓名");
            //    userName = Console.ReadLine();
            //    Console.WriteLine("请输入用户密码");
            //    userPassward = Console.ReadLine();
            //    UserLonggin(userName, userPassward, out judgeUsername, out judgeUserpassward);
            //    if (judgeUsername != true || judgeUserpassward != true)
            //    {
            //        Console.WriteLine("用户名或密码错误\n请重新输入");
            //        continue;
            //    }
            //    else
            //    {
            //        break;
            //    }
            //}
            #endregion
            //bool test = true;
            //int x=2;
            //if(!test)
            //{
            //    Console.WriteLine("test");
            //}
            //Test(ref x);
            //Console.WriteLine(x);
            //test2 x = new test2(;
            ////x.InIt();
            //Console.WriteLine(x.Age);
            //Console.WriteLine(x.Tele);
            static与unstatic x = new static与unstatic();
            x.test2();
            static与unstatic.test1();


        }

       static void Test(ref int x)
        {
            x = 3;
        }
        /// <summary>
        /// 返回最大值啊啊a,b
        /// </summary>
        /// <param name="a">第一个整数</param>
        /// <param name="b">第二个整数</param>
        /// <returns>最大值 </returns>
        public static int Max(int a, int b)
        {
            if (a > b)
            {
                return a;
            }
            else
            {
                return b;
            }

        }

        public static int GetNnumber()
        {
            int a = 0;
            int b = 0;
            while (true)
            {
                Console.WriteLine("请输入第一个数字");
                if (int.TryParse(Console.ReadLine(), out a) == true)
                {
                    break;
                }
                else
                {
                    Console.WriteLine("输入错误");
                }
            }
            while (true)
            {
                Console.WriteLine("请输入第二个数字");
                if (int.TryParse(Console.ReadLine(), out b) == true)
                {
                    break;
                }
                else
                {
                    Console.WriteLine("输入错误");
                }
            }
            return Max(a, b);




        }

        static student GetStudentInformation()
        {
            student student1;
            student1._age = 18;
            student1._name = "xiaohua";
            student1._sex = "男";

            return student1;





        }
        static void GetStudentInformation(out int age,out string name,out string sex)
        {
            age = 19;
            name = "xiaohua";
            sex = "男";
        }

        static void UserLonggin(string userName,string userPassward,out bool judgeName,out bool judgePassward)
        {

            if (string.Equals(userName, user_name) == true)
            {
                judgeName = true;
            }
            else
            {
                judgeName = false;
            }
            if(string.Equals(userPassward,user_passward)==true)
            {
                judgePassward = true;
            }
            else
            {
                judgePassward = false;
            }

           

        }
    }
}

